﻿angular.module('picShare').controller('albumsPageController', function (
    $scope, $rootScope, albumsSvc, pageLocatorSvc, inMemoryDataSvc, safeApply, httpRequestSvc, imageDataSvc, getImagesSvc) {
    $scope.title = "Albums Page";


    $scope.getUserAngAlbumNames = function (userName, albumName) {
        if (albumName == "No Albums") {
            return;
        }
        inMemoryDataSvc.currrentUserName = userName;
        inMemoryDataSvc.currrentAlbumName = albumName;

        getImagesSvc.getImages(0, 4);
        imageDataSvc.imageCounter = imageDataSvc.imageCounter + 4;
        safeApply($rootScope);
        pageLocatorSvc.goTo("/current-album");
    };
});